const setRem = () => {
  // 动态设置 rem单位
  const width = document.documentElement.clientWidth;
  document.documentElement.style.fontSize = width / 10 + 'px';
}

setRem();

window.addEventListener('orientationchange', setRem)
window.addEventListener('resize', setRem)